package com.xcm.sso;

import com.xcm.filter.SSOLoginFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 单点登录配置
 * created by lq at 2018-05-14 9:38
 **/
@Configuration
public class SSOConfig {

    /**
     * 单点登录过滤器
     *
     * @return
     */
    @Bean
    public FilterRegistrationBean setSSOFilter() {
        FilterRegistrationBean filterBean = new FilterRegistrationBean();
        filterBean.setFilter(new SSOLoginFilter());
        filterBean.setName("SSOLoginFilter");
        filterBean.addUrlPatterns("/*");
        filterBean.setOrder(1);
        return filterBean;
    }
}
